package com.zjm.structural.flyweight.website;

/**
 * 享元模式演示
 */
public class Client {
    public static void main(String[] args) {
        WebSiteFactory webSiteFactory = new WebSiteFactory();
        WebSite webSite1 = webSiteFactory.getWebSiteCategory("新闻");
        webSite1.use(new User("小明"));

        WebSite webSite2 = webSiteFactory.getWebSiteCategory("博客");
        webSite2.use(new User("小红"));
        WebSite webSite3 = webSiteFactory.getWebSiteCategory("博客");
        webSite3.use(new User("小白"));
        WebSite webSite4 = webSiteFactory.getWebSiteCategory("博客");
        webSite4.use(new User("小黑"));

        System.out.println("网站分类总数：" + webSiteFactory.getWebSiteCount());
    }
}
